package org.domain.seam1.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import org.jboss.seam.annotations.security.RoleCheck;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/*
 ---=== TYPESAFE ROLE ANNOTATIONS ===---

 In addition to supporting typesafe permission annotation, Seam Security also provides typesafe
 role annotations that allow you to restrict access to component methods based on the role
 memberships of the currently authenticated user. Seam provides one such annotation out
 of the box, org.jboss.seam.annotations.security.Admin, used to restrict access to a
 method to users that are a member of the admin role (so long as your own application
 supports such a role). To create your own role annotations, simply meta-annotate them with
 org.jboss.seam.annotations.security.RoleCheck, like in this example.

 Any methods subsequently annotated with the @Operator annotation as shown in the above example
 will be automatically intercepted and the user checked for the membership of the corresponding
 role name (which is the lower case version of the annotation name, in this case operator).
 */

@Target(METHOD)
@Documented
@Retention(RUNTIME)
@Inherited
@RoleCheck
public @interface Operator {

}
